from map import Map

class evaluator:
	output = open("outputFile.txt", "a")
	def __init__(self):
		x = 0

	def get_totalmove(self, robot_map):
		assert isinstance(robot_map, Map)
		totalMove = 0
		optimalMove = 0
		unvisitedAccessiable = 0
		for i in range(robot_map.row_size):
			for j in range(robot_map.col_size):
				if robot_map.map[i][j] > 0:
					optimalMove +=1
					totalMove = totalMove + robot_map.map[i][j]
				elif robot_map.map[i][j] == 0:
					optimalMove +=1
					unvisitedAccessiable +=1
		return totalMove, optimalMove, unvisitedAccessiable

	def out_to_file(self, totalMove, optimalMove, ua, time):
		self.output.write("{} {} {} {}{}".format(totalMove,optimalMove,ua,time,"\n"))